﻿using eDataBoard.basePage;
using Newtonsoft.Json.Linq;
using OpcSelfHost.basePage;
using SqlSugar;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;

namespace OpcSelfHost.WebApi.controllers
{
    [RoutePrefix("api")]
    public class TestController : ApiController
    {
        [HttpGet]
        [HttpPost]
        public ReturnMsg select(JObject jsonObj)
        { 
            //连接数据库  
            //DBDapper z = new DBDapper();

            ////模型实体去查询
            //  Flowdata ss = new Flowdata(); 
            // IEnumerable<Flowdata> result = z.GetInfoList<Flowdata>("select * from Flowdata");

            //非实体模型对象去查
            // var S = z.GetInfoList("select * from Flowdata");
            //  var result = S.ToList(); 


            //  string jsonStr = JsonConvert.SerializeObject(jsonObj);
            // // dynamic jsonParams = JsonConvert.DeserializeObject<dynamic>(jsonStr);

            //  return ReturnMsg.setReturnMsg(0,"ss", result);
            return null;

        }

        [HttpGet]
        [HttpPost]
        public ReturnMsg add(JObject jsonObj)
        {
             
            
           //  z.UpdateSql();
            return ReturnMsg.setReturnMsg(0, "success", 111);
        }

    }
}
